﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:n="http://nRoute/schemas/2010/xaml"
    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" 
	x:Class="SimpleShell.Views.Home"
    mc:Ignorable="d"
    d:DesignWidth="640" d:DesignHeight="480">
	<UserControl.Resources>
		<Storyboard x:Name="InitializeStoryboard">
			<DoubleAnimation Duration="0:0:1" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="LayoutRoot" d:IsOptimized="True">
				<DoubleAnimation.EasingFunction>
					<BackEase EasingMode="EaseOut"/>
				</DoubleAnimation.EasingFunction>
			</DoubleAnimation>
		</Storyboard>
		<Storyboard x:Name="CloseStoryboard">
			<DoubleAnimation Duration="0:0:1" To="-800" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="LayoutRoot" d:IsOptimized="True">
				<DoubleAnimation.EasingFunction>
					<BackEase EasingMode="EaseIn"/>
				</DoubleAnimation.EasingFunction>
			</DoubleAnimation>
		</Storyboard>
	</UserControl.Resources>
    
	<i:Interaction.Behaviors>
		<n:BridgeViewModelBehavior/>
	</i:Interaction.Behaviors>
    
    <Grid x:Name="LayoutRoot" Background="White" RenderTransformOrigin="0.5,0.5">
    	<Grid.RenderTransform>
    		<CompositeTransform TranslateY="-800" d:TranslateY="0"/>
    	</Grid.RenderTransform>
        <ScrollViewer x:Name="PageScrollViewer" Style="{StaticResource PageScrollViewerStyle}">

            <StackPanel x:Name="ContentStackPanel">
                <TextBlock Text="Home Page" />
                <StackPanel Margin="22" Background="Gray" DataContext="{Binding CurrentPerson, Mode=TwoWay}">
					<TextBlock Text="First Name" />
					<TextBox Text="{Binding FirstName, Mode=TwoWay}" />
					<TextBlock Text="Second Name" />
					<TextBox Text="{Binding SecondName, Mode=TwoWay}" />
					<TextBlock Text="Age" />
					<TextBox Text="{Binding Age, Mode=TwoWay}" />
                </StackPanel>
                
				<TextBox Height="100" Margin="22" Text="{Binding SerializedPerson, Mode=TwoWay}" TextWrapping="Wrap" />
				
				<Button Content="Serialize">
					<i:Interaction.Triggers>
						<i:EventTrigger EventName="Click">
							<n:ExecuteCommandAction Command="{Binding SerializeCommand}"/>
						</i:EventTrigger>
					</i:Interaction.Triggers>
				</Button>
				
				<Button Content="Deserialize">
					<i:Interaction.Triggers>
						<i:EventTrigger EventName="Click">
							<n:ExecuteCommandAction Command="{Binding DeserializeCommand}"/>
						</i:EventTrigger>
					</i:Interaction.Triggers>
                </Button>

                <Button Content="Back">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                            <n:DirectionalNavigateAction Direction="Back" />
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                </Button>

                <Button Content="Empty Page">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                            <n:NavigateAction Url="about:blank" />
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                </Button>

            </StackPanel>

        </ScrollViewer>
    </Grid>
</UserControl>
